extends layout

block content
	div.container
		if user.type == 'teacher'
			h3 Welcome, #{user.username} 老师
		else
			h3 Welcome, #{user.username} 同学
		ul(class="nav nav-tabs")
			li(role="presentation")
				a(href="/") Course Page
			li(role="presentation" class="active")
				a(href="/home") My Home Page
			li(role="presentation" class="navbar-right")
				a(href="/signout") Signout
		if user.type == 'teacher'
			br
			div.ui.yellow.message 
				h1 All homeworks you post:
			each item in homeworks
				div.ui.piled.segment
					h2 <b>#{item.title}</b>
					div !{item.description}
						p 开始时间: <code>#{item.startDate}</code>
						p 截止时间: <code>#{item.endDate}</code>
				br
		if user.type == 'student'
			br
			div.ui.yellow.message 
				h1 All your submits:
			each item in submits
				div.ui.piled.segment
					h2 <b>#{item.title}</b>
					div !{item.description}
						p 作者: #{item.author}
						p 提交时间: <code>#{item.submitDate}</code>
						if item.grade
							p 分数: <code>#{item.grade}</code>
						else
							p 分数: 未给出分数
				br